package com.itheima.reggie.common;

public class ThreadLocalUtils {
    public static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<>();

    // 设置值到当前线程的绑定map中
    public static void set(Long id){
        THREAD_LOCAL.set(id);
    }

    // 从当前线程的绑定map中获取数据
    public static Long get(){
       return THREAD_LOCAL.get();
    }

    // 从当前线程的绑定map中移除数据
    public static void remove(){
        THREAD_LOCAL.remove();
    }

}